package com.common.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Size;

@Data
@TableName("bl_comment")
@ApiModel("评论表")
public class Comment {

    @TableId(type = IdType.AUTO)
    Long commentId;

    @ApiModelProperty("关联commentId")
    Long parentCommentId;

    @NotEmpty(message = "评论内容不能为空")
    @Size(max = 5000, message = "评论内容不能超过2500个字")
    @ApiModelProperty("评论内容")
    String content;

    @NotEmpty(message = "关联文章不能为空")
    @ApiModelProperty("关联文章Id")
    Long articleId;

    @NotEmpty(message = "发布者ID 不能为空")
    @ApiModelProperty("发布者Id")
    Long fromUserId;

    @NotEmpty(message = "发布昵称不能为空")
    @ApiModelProperty("发布者昵称")
    String fromUserNickname;

    @ApiModelProperty("发布用户头像")
    String fromUserAvatar;

    @ApiModelProperty("回复用户Id")
    Long toUserId;

    @ApiModelProperty("回复用户昵称")
    String toUserNickname;

    @ApiModelProperty("回复用户头像")
    String toUserAvatar;

    @NotEmpty(message = "发布时间不能为空")
    @ApiModelProperty("发布时间")
    Integer createTime;

    @ApiModelProperty("点赞数")
    Integer likeNumber;

    @NotEmpty(message = "评论状态不能为空")
    @ApiModelProperty("状态")
    Byte status;
}
